<template>
  <el-config-provider :locale="locale">
    <div>
      <router-view v-if="!$route.meta.show_site" />
      <el-container v-if="$route.meta.show_site">
        <div
          @mouseenter="change_aside_menu('enter')"
          @mouseleave="change_aside_menu('leave')"
        >
          <el-aside :width="isCollapse ? '65px' : '200px'">
            <Aside :Collapse="isCollapse"></Aside>
          </el-aside>
        </div>
        <el-container>
          <el-header>
            <Header></Header>
          </el-header>
          <el-main>
            <router-view></router-view>
          </el-main>
          <el-footer>
            <Footer></Footer>
          </el-footer>
        </el-container>
      </el-container>
    </div>
  </el-config-provider>
</template>
<script>
import { ElConfigProvider } from "element-plus"; //配置中文
import zhCn from "element-plus/lib/locale/lang/zh-cn"; //引入语言
import Aside from "/src/unitui/ui/Aside.vue"; //左侧菜单
import Header from "/src/unitui/ui/Header.vue"; //顶部菜单
import Footer from "/src/unitui/ui/Footer.vue"; //底部菜单
export default {
  components: {
    Aside,
    Header,
    Footer,
    [ElConfigProvider.name]: ElConfigProvider,
  },
  data() {
    return {
      isCollapse: true,
      locale: zhCn,
    };
  },
  methods: {
    change_aside_menu(data) {
      if (data == "enter") {
        this.isCollapse = false;
      } else {
        this.isCollapse = true;
      }
    },
  },
  mounted() {},
};
</script>
<style>
</style>
